package com.youlai.boot.system.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.youlai.boot.common.annotation.Log;
import com.youlai.boot.common.enums.LogModuleEnum;
import com.youlai.boot.common.result.PageResult;
import com.youlai.boot.system.model.event.query.PlatePageQuery;
import com.youlai.boot.system.model.vo.PlatePageVO;
import com.youlai.boot.system.service.PlateService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 板材控制层
 *
 * @author Ray.Hao
 * @since 2022/10/16
 */
@Tag(name = "03.板材接口")
@RestController
@RequestMapping("/api/v1/plate")
@RequiredArgsConstructor
public class PlateController {
    private final PlateService plateService;
    @Operation(summary = "板材分页列表")
    @GetMapping("/page")
    @Log(value = "板材分页列表", module = LogModuleEnum.PLATE)
    public PageResult<PlatePageVO> getPlatePage(
            PlatePageQuery queryParams
    ) {
        Page<PlatePageVO> result = plateService.getPlatePage(queryParams);
        return PageResult.success(result);
    }

}
